<?php 
class welcome extends CI_Controller {

	/**
	 * 用户版默认contoller
	 * add by laohyx
	 * 
	 */
		function __construct(){
			parent::__construct();
			$this->load->model('user/user_model');
			$this->load->model('user/setting_model');
			$this->setting=$this->setting_model->getSetting();
			$this->user=$this->user_model->get_user();
		}
	public function index(){
			$this->load->model('recall/recall_paper_model');
			$this->load->model('recall/recall_problem_model');
			$this->load->model('share/file');
			$top['title']=$this->recall_paper_model->top_sth(10,'title');
			$top['j_id']=$this->recall_paper_model->top_sth(10,'j_id');
			$top['hit_cnt']=$this->recall_paper_model->top_sth(10,'hit_cnt');
			$top['u_id']=$this->recall_paper_model->top_sth(10,'u_id');
			$i=0;
			foreach($top['u_id'] as $uid){
				$top['username'][$i]=$this->user_model->get_user_name($uid);
				$i++;
			}
			$top['tags']=$this->recall_paper_model->top_sth(10,'tags');
			$top['problem']=$this->recall_problem_model->read_recall_problem(-1,5,0,"creat_time","desc");
			$rank=$this->file->get_rank();
			$alluserlist=$this->user_model->list_by_credit(0,$this->setting['list_indexallscore']);
			$weekuserlist=$this->user_model->list_by_credit(1,$this->setting['list_indexallscore']);
			$question=$this->user_model->get_question();
			$data=array(
				'title'=>'学海拾贝',
				'regular'=>'index/user',
				'top'=>$top,
				'rank'=>$rank,
				'setting'=>$this->setting,
				'user'=>$this->user,
				'alluserlist'=>$alluserlist,
				'weekuserlist'=>$weekuserlist,
				'question'=>$question
			);
			$this->load->view('header',array('title'=>'学海拾贝'));
			$this->load->view('user/user_rightcolumn',$data);
			$this->load->view('footer',$data);
			
		}
}


/* End of file index.php */
/* Location: ./application/controllers/../index.php */
